<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <style>
        @font-face {
  font-family: 'iconfont';  /* project id 1828232 */
  src: url('//at.alicdn.com/t/font_1828232_x54w3dvatos.eot');
  src: url('//at.alicdn.com/t/font_1828232_x54w3dvatos.eot?#iefix') format('embedded-opentype'),
  url('//at.alicdn.com/t/font_1828232_x54w3dvatos.woff2') format('woff2'),
  url('//at.alicdn.com/t/font_1828232_x54w3dvatos.woff') format('woff'),
  url('//at.alicdn.com/t/font_1828232_x54w3dvatos.ttf') format('truetype'),
  url('//at.alicdn.com/t/font_1828232_x54w3dvatos.svg#iconfont') format('svg');
}

.iconfont{
    font-family:"iconfont" !important;
    font-size:32px;font-style:normal;
    -webkit-font-smoothing: antialiased;
    -webkit-text-stroke-width: 0.2px;
    -moz-osx-font-smoothing: grayscale;}
    </style>
</head>
<body>


<div id="toTop">
    <span id="BackTop" class="iconfont">&#xe632;</span>
</div>

<script>
    // 向上滚动的函数
    $(function () {
        $('#BackTop').click(function () {
            $('html,body').animate({scrollTop: 0}, 300);
        });
        $(window).scroll(function () {
            if ($(this).scrollTop() > 300) {
                $('#BackTop').fadeIn(300);
            } else {
                $('#BackTop').stop().fadeOut(300);
            }
        }).scroll();
    });
</script>


</body>
</html>